package com.bocai.movie.api;

import com.bocai.Response;
import com.bocai.movie.service.MovieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author create by VIC.Huang
 * @date 2018/4/1
 */
@RestController
@RequestMapping("/movie")
public class MovieApi {
    @Autowired
    private MovieService movieService;

    @GetMapping("/list")
    public Response movieList(@RequestParam(value = "page", required = false, defaultValue = "1") int page,
                              @RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize) {
        return new Response(movieService.list(page, pageSize));
    }
}
